import com.ynny.bean.Students;
import com.ynny.dao.StudentsDaoImpl;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test {
    @Test
    public void test() {
        ClassPathXmlApplicationContext classPathXmlApplicationContext =
                new ClassPathXmlApplicationContext( "applicationContext.xml");
     StudentsDaoImpl studentsDao = classPathXmlApplicationContext.getBean("studentsDaoImpl", StudentsDaoImpl.class);
       // studentsDao.insertStudents("000002", "小高", "男", "计算机科学", "20");
       // studentsDao.updateStudents("000001", "大二", "软件技术", "男", "小明");
//        List<Students> students = studentsDao.selectAll();
//        for (Students student : students) {
//            System.out.println(student);
//        }


//     Students students = studentsDao.getStudents("000002");
//        System.out.println(students);
        int i = studentsDao.update(new Students("000002", "大三", "软件技术", "女", "小高"));

    }
}
